<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-merchant-edit" th:object="${merchant}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">商户名称：</label>
				<div class="col-sm-8">
					<input id="merchantCnName" name="merchantCnName" th:field="*{merchantCnName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">身份证号：</label>
				<div class="col-sm-8">
					<input id="idCardNumber" name="idCardNumber" th:field="*{idCardNumber}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">开户银行：</label>
				<div class="col-sm-8">
					<select id="bankCode" name="bankCode" class="form-control">
						<option th:each="issBank : ${issBank}" th:text="${issBank['bankName']}" th:value="${issBank['bankCode']}" th:field="*{bankCode}"></option>
					</select>

				</div>
			</div>



			<div class="form-group">
				<label class="col-sm-3 control-label">银行账户：</label>
				<div class="col-sm-8">
					<input id="bankAccount" name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">账号开户人：</label>
				<div class="col-sm-8">
					<input id="bankAccountName" name="bankAccountName" th:field="*{bankAccountName}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">商户银联号：</label>
				<div class="col-sm-8">
					<input id="bankDot" name="bankDot" th:field="*{bankDot}" class="form-control" type="text">
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/merchant"
		$("#form-merchant-edit").validate({
			rules:{
				merchantCnName:{
					required:true,
				},
				idCardNumber:{
					required:true,
				},
				bankCode:{
					required:true,
				},
				bankAccount:{
					required:true,
				},
				bankAccountName:{
					required:true,
				},
				bankDot:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/editMerchant", $('#form-merchant-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
